﻿<UserControl x:Class="P_PersonalDetails.ContactNumbers"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="400" d:DesignWidth="600">
    <UserControl.Resources>
        <ResourceDictionary Source="FormStyling.xaml"/>
    </UserControl.Resources>
    <Border Style="{StaticResource BoxBorder}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <TextBlock Style="{StaticResource BoxHeading}">
                <Run Text="Contact numbers for"/>
                <Run Text="{Binding FullName}"/>
            </TextBlock>
            <TextBlock Style="{StaticResource SubText}" Grid.Row="1">(Please provide at least 2 methods of contact if possible)</TextBlock>
            <TextBlock Grid.Row="2" Style="{StaticResource SubText}">
                <Run Text="Please tick the &quot;opt out&quot; box if you do"/>
                <Run TextDecorations="Underline" Text="not"/>
                <Run Text="want the contact number distributed to other club members.  We will not pass this information to 3rd"/>
                
                <Run Text="parties without your consent."/>
            </TextBlock>
            <Grid Grid.Row="3">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="150"/>
                    <ColumnDefinition Width="*" MaxWidth="300"/>
                    <ColumnDefinition Width="70"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="2">Opt Out</TextBlock>
                <ItemsControl ItemsSource="{Binding ContactDetails}" Grid.ColumnSpan="3" Grid.Row="1">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="150"/>
                                    <ColumnDefinition Width="*" MaxWidth="300"/>
                                    <ColumnDefinition Width="70"/>
                                </Grid.ColumnDefinitions>
                                <TextBlock Text="{Binding Name}" FontSize="16"/>
                                <TextBox Text="{Binding Mode=TwoWay, ValidatesOnExceptions=True, Path=ContactValueB, ValidatesOnDataErrors=True}"
                                         MaxLength="{Binding MaxLength}" Grid.Column="1"/>
                                <CheckBox IsChecked="{Binding ContactOptOutB, Mode=TwoWay, ValidatesOnExceptions=True}" Grid.Column="2"/>
                            </Grid>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </Grid>
            <TextBlock Grid.Row="4" Style="{StaticResource SubText}">
                (Note: membership renewal reminder notices and other key information will be sent to both email addresses.  For those under 18 it can be useful to have a parent's email as the 2nd address)
            </TextBlock>
        </Grid>
    </Border>
</UserControl>
